using MenusHunter.WinRT.Core.Services.Restaurant;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace MenusHunter.WinRT.Helpers
{
    public class RestaurantItemTemplateSelector:DataTemplateSelector
    {
        public DataTemplate FeatureTemplate { get; set; }
        public DataTemplate NormalTemplate { get; set; }
        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            if (item is Restaurant)
            {
                var rest = item as Restaurant;
                if (rest.IsFeature)
                {
                    return FeatureTemplate;
                }
                return NormalTemplate;
            }
            return base.SelectTemplateCore(item, container);
        }
    }
}